/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.buzzwords.behaviors;

import com.buzzwords.model.Buzzword;
import com.google.appengine.api.datastore.Key;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 *
 * @author potlow
 */
public class BuzzwordKeyBehavior extends BuzzwordBehavior {

    @Override
    public List<Object> read(Object value, List<String> properties) {
        
        Key key;
        if (value instanceof Key) {
            key = (Key) value;
        } else {
            throw new IllegalArgumentException("Search value must be a Key");
        }

        Object tour = pm.getObjectById(Buzzword.class, key);

        return Arrays.asList(tour);
    }

    @Override
    public List<Object> excute(String filter, String declareParameters, Map<String, Object> parameters, List<String> properties) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
